using System.Net.Http;
using AutoMapper;
using Common.Commands.MemberCommands;
using Dto.ApiRequests.MemberForms;
using WebApp.Services;

namespace WebApp.ControllerApis
{
    public class MemberNotificationController : SmartApiController
    {
        public MemberNotificationController(IUserSession userSession, IMappingEngine mappingEngine)
            : base(userSession, mappingEngine)
        {
        }

        public HttpResponseMessage Put(MemberNotificationForm form)
        {
            var command = new UpdateMemberNotification
                {
                    Id = form.Id,
                    Email = form.Email,
                    Mobile = form.Mobile,
                    Block = form.Block,
                    SendSms = form.SendSms,
                    SendEmail = form.SendEmail,
                    UsePrint = form.UsePrint
                };

            return ExecuteCommand(command);
        }
    }
}